<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhUserWrongQuestionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_user_wrong_questions', function (Blueprint $table) {
            $table->id();
            $table->integer('userId', false, true)->unique()->comment('用户ID');
            $table->text('data')->nullable()->comment('数据');
            $table->integer('questionCount')->default(0)->comment('错题数量');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE qh_user_wrong_questions comment '用户的错题记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_user_wrong_questions');
    }
}
